package cn.kgc.service.impl;

import cn.kgc.entity.Xqz;
import cn.kgc.mapper.XqzMapper;
import cn.kgc.service.XqzService;
import cn.kgc.vo.Page;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
@Slf4j
public class XqzServiceImpl implements XqzService {

    @Resource
    private XqzMapper xqzMapper;

    @Override
    public List<Xqz> getAllXqz(Integer pageNo, Integer pageSize) {
        return xqzMapper.getAllXqz(new Page(pageNo,pageSize));
    }

    @Override
    public Xqz getXqzById(Integer id) {
        return xqzMapper.getXqzById(id);
    }

    @Override
    public void addXqz(Xqz xqz) {
        xqzMapper.addXqz(xqz);
        log.debug("8====D - - - addXqz:"+xqz);
    }

    @Override
    public void updateXqz(Xqz xqz) {
        xqzMapper.updateXqz(xqz);
    }

    @Override
    public void deleteXqzById(Integer id) {
        xqzMapper.deleteXqzById(id);
    }

    @Override
    public Integer countXqzByName(String name) {
        return xqzMapper.countXqzByName(name);
    }

    @Override
    public Integer countXqz() {
        return xqzMapper.countXqz();
    }
}
